<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Demo3-1-6</title>
<script type="text/javascript">
var xml;
var xsl;
//create Objects
if (typeof window.ActiveXObject != 'undefined') {
	xml = new ActiveXObject("Microsoft.XMLDOM");
	xsl = new ActiveXObject("Microsoft.XMLDOM");
}
else if (document.implementation && document.implementation.createDocument) {
	xml = document.implementation.createDocument("", "", null);
	xsl = document.implementation.createDocument("", "", null);
}

//LoadXML
xml.async = false;
xml.load("message.xml");

//LoadXSL
xsl.async = false;
xsl.load("messageTransform.xsl");

//Transform
if (typeof window.ActiveXObject != 'undefined') {
	document.write(xml.transformNode(xsl));
}
else if(document.implementation && document.implementation.createDocument) {
	var xsltProcessor = new XSLTProcessor();
	xsltProcessor.importStylesheet(xsl);
	//transform to document
	var result = xsltProcessor.transformToDocument(xml);
	var xmls = new XMLSerializer();
	document.write(xmls.serializeToString(result));
}

</script>
</head>
<body>

</body>
</html>